package com.ibsol.business
{
	import com.adobe.cairngorm.business.ServiceLocator;
	
	import mx.rpc.AsyncToken;
	import mx.rpc.IResponder;
	
	public class DemoDelegate
	{
		private var _responder:IResponder;
		private var _service:Object;
		
		public function DemoDelegate(responder:IResponder)
		{
			this._responder = responder;
			this._service = ServiceLocator.getInstance().getRemoteObject("demoService");
		}
		
		public function echoFromJava():void{
			var call:Object = this._service.echoFromJava();
//			var call:AsyncToken = this._service.echoFromJava();
			// return value is AsyncTocken, addResponder(responder:IResponder) will adds a 
			// responder to responders array
			call.addResponder(_responder);
		}

	}
}